
{extend name="index/admin-index" /}
{block name="main"}

  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl"><strong class="am-text-primary am-text-lg">文章详情</strong> </div>
      </div>

      <hr/>

      <div class="am-g error-log">
        <div id='' class="am-u-sm-12 am-u-sm-centered">
           <a href="javascript:void(0)" id="button" class="btn btn-danger" abs="{$data.id}">{if condition="$data.tj_status eq '1'"}取消推荐
           {else /} 设为推荐
           {/if}</a><br><br>
        <pre class="am-pre-scrollable">

            <center>   <h2>{$data.title}</h2> </center><br>

            <div style="margin-left:40px">{$data.content}</div>

        </pre>
         
        </div>
      </div>
    </div>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>
  </div>

  <script>
      $('#button').click(function(){
        var id=$(this).attr('abs');
        $.ajax({
            type: 'get',
            url: "{:url('admin/Category/recommend')}",
            data: 'id='+id,
            dataType:'json',
            success: function(data){
             console.log(data);
            if (data===1) {
              $('#button').html('取消推荐');
            }else{
               $('#button').html('设为推荐');
            }

              }


            })
        });
     
  </script>
  

{/block}
